<?php
/**
 * Created by PhpStorm.
 * User: dream
 * Date: 2017/8/21
 * Time: 18:48
 */

$config = [

    ADMIN."myself/safe"=>
    [
        [
            'field'=>"old_password",
            'label'=>"原密码",
            "rules"=>"required|min_length[6]|max_length[10]",
            'errors'=>
                [
                    'required'=>"%s必须填写",
                    'min_length'=>"%s不能少于6个字符",
                    'max_length'=>"%s不能超过10个字符"
                ]
        ],
        [
            'field'=>"password",
            'label'=>"新密码",
            "rules"=>"required|min_length[6]|max_length[10]",
            'errors'=>
                [
                    'required'=>"%s必须填写",
                    'min_length'=>"%s不能少于6个字符",
                    'max_length'=>"%s不能超过10个字符"
                ]
        ],
        [
            'field'=>"confirm_password",
            'label'=>"确认密码",
            "rules"=>"required|min_length[6]|max_length[10]|matches[password]",
            'errors'=>
                [
                    'required'=>"%s必须填写",
                    'min_length'=>"%s不能少于6个字符",
                    'max_length'=>"%s不能超过10个字符"
                ]
        ],

    ],

    ADMIN."login/index"=>
    [

        [
            'field'=>'user_name',
            'label'=>"用户名",
            'rules'=>"required|valid_email",
            'errors'=>
                [
                    "required"=> "%s必须填写",
                    "valid_email"=>"%s格式不正确"
                ]
        ],
        [
            'field'=>"password",
            'label'=>"密码",
            "rules"=>"required|min_length[6]|max_length[10]",
            'errors'=>
                [
                    'required'=>"%s必须填写",
                    'min_length'=>"%s不能少于6个字符",
                    'max_length'=>"%s不能超过10个字符"
                ]
        ],
        [
            'field'=>"img_code",
            'label'=>"验证码",
            "rules"=>"required|callback_check_img_code",
            'errors'=>
                [
                    'required'=>"%s必须填写",
                    'check_img_code'=>"%s不正确"
                ]
        ]


    ],
    ADMIN."login/register"=>
    [
        [
            'field'=>'user_name',
            'label'=>"用户名",
            'rules'=>"required|valid_email",
            'errors'=>
                [
                    "required"=> "%s必须填写",
                    "valid_email"=>"%s格式不正确"
                ]
        ],
        [
            'field'=>"password",
            'label'=>"密码",
            "rules"=>"required|min_length[6]|max_length[10]",
            'errors'=>
            [
                'required'=>"%s必须填写",
                'min_length'=>"%s不能少于6个字符",
                'max_length'=>"%s不能超过10个字符"
            ]
        ],
        [
            'field'=>"confirm_password",
            'label'=>"确认密码",
            "rules"=>"required|min_length[6]|max_length[10]|matches[password]",
            'errors'=>
            [
                'required'=>"%s必须填写",
                'min_length'=>"%s不能少于6个字符",
                'max_length'=>"%s不能超过10个字符",
                'matches'=>"%s不一致"
            ]
        ],
        [
            'field'=>"email_code",
            'label'=>"邮箱验证码",
            "rules"=>"required|callback_check_email_code",
            'errors'=>
                [
                    'required'=>"%s必须填写",
                    'check_email_code'=>"%s不正确"
                ]
        ]

    ]

];